<!DOCTYPE html>
<html ng-app="myApp">

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
	</head>
	<script type="text/javascript">
		angular.module('myApp', [])
			.controller('myCtrl', ['$scope', '$templateCache', function($scope, $templateCache) {
				var tmp = '<h4>lovestory</h4>' +
					'<p>这是直接调用$templateCache服务获取模板文件的方式</p>' +
					'<a href="http://www.baidu.com">服务启用templateCache方式</a>';
				$templateCache.put('lovestory.html', tmp);
			}])
	</script>

	<body>
		<div ng-controller="myCtrl">
			<div id="" ng-include="'lovestory.html'"></div>
			<div id="" ng-include="'lovestoryone.html'"></div>
		</div>
		<script type="text/ng-template" id="lovestoryone.html">
			<h4>lovestory</h4>
			<p>这是script标签获取模板文件的方式</p>
			<a href="http://www.baidu.com">标签启用templateCache方式</a>
		</script>
	</body>

</html>